import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: "知识库",
  description: "温故而知新",
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      // { text: "Home", link: "/" },
      { text: "Vue", link: "/vue/" },
      { text: "JS", link: "/js/" },
      { text: "CSS", link: "/css/" },
      { text: "有趣的库", link: "/packages/" },
      { text: "Vscode 配置", link: "/vscode/" },
      { text: "记录", link: "/record/zOneYear" },
      {
        text: "扩展",
        items: [
          {
            text: "docker",
            link: "/expansion/docker",
          },
          {
            text: "node",
            link: "/expansion/node",
          },
          {
            text: "git",
            link: "/expansion/git",
          },
          {
            text: "Flutter",
            link: "/expansion/flutter",
          },
          {
            text: "Browser",
            link: "/expansion/browser",
          },
          {
            text: "面经",
            link: "/expansion/interview",
          },
        ],
      },
      {
        text: "React",
        link: "/react/",
      },
    ],

    // 多侧边栏设置
    // https://vitepress.dev/zh/reference/default-theme-sidebar#multiple-sidebars
    sidebar: {
      "/vscode/": [
        {
          text: "Vscode 配置",
          items: [
            { text: "推荐配置", link: "/vscode/recommend" },
            { text: "插件推荐", link: "/vscode/plugins" },
          ],
        },
      ],
      "/vue/": [
        {
          text: "Vue",
          items: [
            { text: "创建项目", link: "/vue/create" },
            { text: "jsx介绍", link: "/vue/jsx" },
          ],
        },
      ],
      "/js/": [
        {
          text: "JS",
          items: [
            {
              text: "性能优化",
              link: "/js/optimizations",
            },
            {
              text: "易混点",
              link: "/js/difference",
            },
            {
              text: "通信分析",
              link: "/js/communication",
            },
            {
              text: "canvas画布",
              link: "/js/canvas",
            },
            {
              text: "axios",
              link: "/js/axios",
            },
            {
              text: "需求点",
              link: "/js/functions",
            },
          ],
        },
      ],
      "/css/": [
        {
          text: "CSS汇总",
          items: [
            {
              text: "基本知识",
              link: "/css/basic",
            },
          ],
        },
      ],
      "/packages/": [
        {
          text: "后端 (NodeJs)",
          link: "/packages/back-end",
          items: [
            {
              text: "Express",
              link: "/packages/back-end/express",
            },
            {
              text: "Fastify",
              link: "/packages/back-end/fastify",
            },
            {
              text: "Sequelize",
              link: "/packages/back-end/sequelize",
            },
            {
              text: "Mongoose",
              link: "/packages/back-end/mongoose",
            },
            {
              text: "ShareDB",
              link: "/packages/back-end/sharedb",
            },
          ],
        },
        {
          text: "前端",
          link: "/packages/front-end",
          items: [
            {
              text: "tinykeys (按键绑定)",
              link: "/packages/front-end/tinykeys",
            },
          ],
        },
      ],
      "/record/": [
        {
          text: "工作记录",
          items: [
            { text: "yeaon-前端工作一年", link: "/record/zOneYear" },
            { text: "yeaon-工作心得", link: "/record/zTwoYear" },
          ],
        },
      ],
    },

    socialLinks: [
      {
        icon: "github",
        link: "https://gitee.com/Zhukon/knowledge-base/tree/master/",
      },
    ],
    search: {
      provider: "local",
    },
  },
});
